Previous Book Contents Book Index Next

Inside Macintosh: 3D Graphics Programming With QuickDraw 3D /
Chapter 20 - QuickDraw 3D Mathematical Utilities / QuickDraw 3D Mathematical Utilities Reference
QuickDraw 3D Mathematical Utilities / Managing Quaternions


Q3Quaternion_Multiply

You can use the Q3Quaternion_Multiply function to multiply two quaternions.

TQ3Quaternion *Q3Quaternion_Multiply (
const TQ3Quaternion *q1, 
const TQ3Quaternion *q2, 
TQ3Quaternion *result);
q1
A quaternion.
q2
A quaternion.
result
On exit, the product of q1 and q2.
DESCRIPTION
The Q3Quaternion_Multiply function returns, as its function result and in the result parameter, the product of the two quaternions q1 and q2.

If you want to rotate an object by the quaternion qFirst and then rotate the resulting object by the quaternion qSecond, you can accomplish both rotations at once by applying the quaternion qResult that is obtained as follows:

Q3Quaternion_Multiply(qSecond, qFirst, qResult);
Note the order of the quaternion multiplicands.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
11 JUL 1996